home *** CD-ROM | disk | FTP | other *** search
/ Apple II Magazines (PO) / Nibble Volume 11, No. 10 (1990-10)(MindCraft Publishing)(Side A)[a].zip / Nibble Volume 11, No. 10 (1990-10)(MindCraft Publishing)(Side A)[a].po / READ80.S < prev    next >
Text File  |  1996-12-24  |  4KB  |  80 lines

  1. ********************************
  2. l
  3. l
  4. l
  5. * READ80 Source Code           *
  6. * By Rudy A. Guy               *
  7. * Copyright (c) 1990           *
  8. * MindCraft Publishing Corp.   *
  9. * Concord, MA 01742            *
  10. ********************************
  11. *                              *
  12. * MindCraft Assembler          *
  13. *                              *
  14. ********************************
  15.           ORG $801       ;origin
  16. MAIN_MEM  EQU $C054      ;80 column softswitch
  17. AUX_MEM   EQU $C055      ;80 column softswitch
  18. LINE1     EQU $531       ;memory location of 1st line of input
  19. LINE2     EQU $5B1       ;memory location of 2nd line of input
  20. LINE3     EQU $631       ;memory location of 3rd line of input
  21. BLD_STR   EQU $801       ;move screen memory here
  22.                DFS $B5   ;reserve 180 bytes
  23. START     LDX #$00
  24.           LDA #$20       ;put a space character into acc.
  25. CLEAR     STA BLD_STR,X  ;put space into reserved memory
  26.           INX
  27.           CPX #$B4       ;All 180 bytes filled with spaces?
  28.           BNE CLEAR      ;If not - continue
  29.           LDX #$00
  30.           LDY #$00
  31. READ_60   BIT AUX_MEM    ;prepare to read from aux. screen memory
  32.           LDA LINE1,Y    ;read a character from screen
  33.           STA BLD_STR,X  ;move character to reserved memory
  34.           BIT MAIN_MEM   ;prepare to read from main screen memory
  35.           LDA LINE1,Y    ;read a character from screen
  36.           INX            ;increment pointer to reserved memory
  37.           STA BLD_STR,X  ;move character to reserved memory
  38.           INX            ;increment pointer to reserved memory
  39.           INY            ;increment the number of screen reads
  40.           CPY #$1E       ;All of the line read?
  41.           BEQ NEXT_60    ;If 60 characters read then do next line
  42.           JMP READ_60    ;Continue reading this line
  43. NEXT_60   LDY #$00       ;Initialize counter for second line
  44. READ_120  BIT AUX_MEM    ;prepare to read from aux. text screen
  45.           LDA LINE2,Y    ;read a character
  46.           STA BLD_STR,X  ;move it to reserved bytes
  47.           BIT MAIN_MEM   ;prepare to read from main text screen
  48.           LDA LINE2,Y    ;read a character
  49.           INX            ;increment pointer to reserved bytes
  50.           STA BLD_STR,X  ;move character to reserved bytes
  51.           INX            ;increment pointer to reserved bytes
  52.           INY            ;increment the number of screen reads
  53.           CPY #$1E       ;done reading?
  54.           BEQ FINAL_60   ;if yes - read final 60 characters
  55.           JMP READ_120   ;continue reading current line
  56. FINAL_60  LDY #$00       ;initialize counter for final reads
  57. READ_180  BIT AUX_MEM    ;prepare to read from aux. text screen
  58.           LDA LINE3,Y    ;read a character
  59.           STA BLD_STR,X  ;move character to reserved memory
  60.           BIT MAIN_MEM   ;prepare to read from main text screen
  61.           LDA LINE3,Y    ;read a character
  62.           INX            ;increment pointer to reserved memory bytes
  63.           STA BLD_STR,X  ;store character in reserved memory
  64.           INX            ;increment pointer to reserved memory bytes
  65.           INY            ;increment the number of reads performed
  66.           CPY #$1E       ;done?
  67.           BEQ DONE       ;if yes - exit read routine
  68.           JMP READ_180   ;continue reading current line
  69. DONE      LDX #$00       ;prepare to move reserved bytes to string loc.
  70. MOVE_IT   LDA BLD_STR,X  ;get 1st character from reserved memory
  71.           SEC            ;set carry
  72.           SBC #$80       ;subtract 128 from character code
  73.           DFC $9D,$00,$00 ;move character to locations poked from BASIC
  74.           INX            ;increment counter
  75.           CPX #$B4       ;all characters moved?
  76.           BEQ END        ;if yes - exit move routine
  77.           JMP MOVE_IT    ;continue moving characters
  78. END       RTS            ;back to BASIC
  79. q
  80.